#!/bin/sh
HOST="http://192.168.22.32:2046"
INDEX="index=mysql"
SEARCH="$HOST/search?$INDEX"
Q="q=%E5%B0%91%E7%94%B7"
EXT="matchmode=SPH_MATCH_EXTENDED2&rankingmode=SPH_RANK_PROXIMITY_BM25&sortmode=SPH_SORT_RELEVANCE"

#return `echo -n "$1" | od -An -tx1 | tr ' ' %`

CURL="curl -v -g"

MATCH="matchmode=SPH_MATCH_EXTENDED2"
RANK="rankingmode=SPH_RANK_PROXIMITY_BM25"
SORT="sortmode=SPH_SORT_RELEVANCE"
$CURL "${SEARCH}&${Q}&${MATCH}&${RANK}&${SORT}"
exit
MATCH="matchmode=SPH_MATCH_ALL"
RANK="rankingmode=SPH_RANK_PROXIMITY_BM25"
SORT="sortmode=SPH_SORT_RELEVANCE"
GROUPBY="groupby=SPH_GROUPBY_ATTR:group_id:@groupby+desc"
$CURL "${SEARCH}&${Q}&${MATCH}&${RANK}&${SORT}&${GROUPBY}"

MATCH="matchmode=SPH_MATCH_EXTENDED2"
RANK="rankingmode=SPH_RANK_PROXIMITY_BM25"
SORT="sortmode=SPH_SORT_RELEVANCE"
IDRANG="idrange=1,10000"
$CURL "${SEARCH}&${Q}&${MATCH}&${RANK}&${SORT}&${IDRANG}"

MATCH="matchmode=SPH_MATCH_EXTENDED2"
RANK="rankingmode=SPH_RANK_PROXIMITY_BM25"
SORT="sortmode=SPH_SORT_RELEVANCE"
FILTER="filter=group_id:%5B1+TO+10%5D"
FIELDWEIGHT="fieldweights=title:2,content:1"
$CURL "${SEARCH}&${Q}&${MATCH}&${RANK}&${SORT}&${FILTER}&${FIELDWEIGHT}"

MATCH="matchmode=SPH_MATCH_EXTENDED2"
RANK="rankingmode=SPH_RANK_PROXIMITY_BM25"
SORT="sortmode=SPH_SORT_RELEVANCE"
LIMIT="start=0&rows=10"
FILTER="filter=group_id:1,2"
FIELDWEIGHT="fieldweights=title:2,content:1"
$CURL "${SEARCH}&${Q}&${MATCH}&${RANK}&${SORT}&${FILTER}&${FIELDWEIGHT}&${LIMIT}"

MATCH="matchmode=SPH_MATCH_EXTENDED2"
RANK="rankingmode=SPH_RANK_PROXIMITY_BM25"
SORT="sortmode=SPH_SORT_RELEVANCE"
LIMIT="start=0&rows=10"
FILTER="filter=group_id:1,2"
FIELDWEIGHT="fieldweights=title:2,content:1"
MAXQTIME="maxquerytime=1000"
$CURL "${SEARCH}&${Q}&${MATCH}&${RANK}&${SORT}&${LIMIT}&${FILTER}&${FIELDWEIGHT}&${MAXQTIME}"

#%E5%85%AC%E5%BC%80 公开
#%E6%A0%A1%E9%95%BF 校长
#%E9%93%B6%E5%85%83 银元
#%E5%B0%91%E7%94%B7 少男

$CURL "$HOST/status"
$CURL "$HOST/statistic"
$CURL "$HOST/"



#%E5%85%AC%E5%BC%80 公开
#%E6%A0%A1%E9%95%BF 校长
#%E9%93%B6%E5%85%83 银元

